﻿@{
    ViewBag.Title = "NewGame";
}

<h2>New Game</h2>

<button id="newGameBtn">Start a new game</button>
                <form method='get' action='/Home/GameChosen'>
    <fieldset>
        <legend>Välj ett spel</legend>
        <select id='gameSelect' name='gameSelect'>
            @foreach (var game in ViewBag.GameTitles)
            {
                <option value=@game.GameId>@game.GameName</option>
            }
    </select>
        <legend>Antal omgångar:</legend>
        <select id='roundsSelect' name='roundsSelect'>
            <option value='3'>3</option>
            <option value='5'>5</option>
            <option value='7'>7</option>
    </select>
    </fieldset>
            <input id='newGameSubmit'type='submit' value='Start game'/>
</form>

<h2>Available Games:</h2>
<p>(Click on an item in the list to join)</p>
<ul>
    @foreach (var game in Model)
    {
        <li><a href="/Home/JoinGame?id=@game.GameSessionId">@game.GameObject.GameName | Players: Unknown | Player name: Unknown</a></li>
    }

</ul>

<script> //När man trycker på starta nytt spel - knappen så visas content för att starta ett nytt spel.
    $("#newGameBtn").on("click", function () {
        

    });

    $("#newGameSubmit").on("click", function () {
        $("#newGameArea").html();
    });

    </script>
